<?php

namespace backend\models;

use Yii;
use yii\helpers\ArrayHelper;
use yii\db\ActiveRecord;
use backend\models\SysItem;
use backend\models\Show;
use backend\models\Taozhuang;
class UserFoot extends \yii\db\ActiveRecord
{
	
	public $visitor_num;
	public $percent;
	public $img;
	
	public  $start_time;
	public  $end_time;
	public  $show_count;
	public  $type;
	
	public $item;
	public $taozhuang;
	public $show;
    /**
     * @inheritdoc
     */
    public static function tableName()
    {
        return 'log_user_footprint';
    }

    /**
     * @inheritdoc
     */
    public function rules()
    {    	
        return [
            [['id','uid','del','calltime','action_id'], 'integer'],
            [['title','action','url'], 'string'],
        ];
    }
    /**
     * @inheritdoc
     */
    public function attributeLabels()
    {
        return [
            'action' => Yii::t('app','类别'),
            'visitor_num' => Yii::t('app','访问量'),
            'title' => Yii::t('app','名称'),
            'percent' => Yii::t('app','占比'),
            'img' => Yii::t('app','图片'),
        ];
    }

    public function getItem() 
    {
    	return $this->hasOne(SysItem::className(),['id'=>'action_id']);
    }
    
    public function getTaozhuang(){
    	return $this->hasOne(Taozhuang::className(),['sid'=>'action_id']);
    }
 
    public function getShow(){
    	return $this->hasOne(Show::className(), ['id'=>'action_id']);
    }
}
